<template>
  <div class="card">
    <img :src="cardObj.img" alt="">

    <div class="footer">
      <img :src="cardObj.avatar" alt="">
      <span>{{cardObj.author}}</span>
      <span @click="handleClick">⚔</span>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    cardObj: {
      type: Object,
      required: true
    }
  },
  methods: {
    handleClick () {
      this.$emit('del', this.cardObj.id)
    }
  }
}
</script>
<style scoped>
.card {
  position: relative;
  width: 430px;
  height: 500px;
}
.card>img {
    width: 430px;
  height: 500px;
}
.footer {
  background-color: rgba(56, 51, 51, 0.37);
  position: absolute;
  bottom: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
</style>
